#include "main_task.h"
#include "main.h"

#include "cmsis_os.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "timers.h"

#define LED1_BLINK() LED1_GPIO_Port->ODR ^= LED1_Pin     //LED1
#define LED2_BLINK() LED2_GPIO_Port->ODR ^= LED2_Pin     //LED1
#define LED3_BLINK() LED3_GPIO_Port->ODR ^= LED3_Pin     //LED1
#define LED4_BLINK() LED4_GPIO_Port->ODR ^= LED4_Pin     //LED1

void MainAppTaskEntrance(void)
{
    MessageId msgRecv = MSG_NONE;


    /* 初始化完毕打印当前编译日期时间 */
    DBG("************************************\n");
    DBG("[data:%s][time:%s]\n", __DATE__, __TIME__);
    DBG("************************************\n");

    /* Infinite loop */
    for (;;)
    {
        //DBG("System running!\r\n");
        LED1_BLINK();
        LED2_BLINK();
        LED3_BLINK();
        LED4_BLINK();
        //if(xQueueReceive(GetMainMessageHandle(), &msgRecv, portMAX_DELAY)== pdTRUE)
        if(xQueueReceive(GetMainMessageHandle(), &msgRecv, 300)== pdTRUE)
        {

        }
    }
}
